import {
	conenctDeviceService,
	startVoice,
	powerOn,
	authenticate
} from '@/uni_modules/pos-sdk'
import {
	formatHexString,
	hexString,
	hex2byteFromString
} from './CodeUtils.js'
export function readData(fun) {
	conenctDeviceService()
	powerOn((res => {
		if (res) {
			console.log(res)
			const re = hexString(res.cardSerialNo)
			fun(formatHexString(re))
		} else {
			uni.$u.toast('请放置卡');
		}
	}))
}